package com.zf.service;

import com.alibaba.dubbo.config.annotation.Service;
import com.zf.api.MyFirstService;
import com.zf.entity.Mod;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;

@Service
@Component
public class MyFirstServiceImpl implements MyFirstService {

    @Override
    public String a(String sss) {
        if (StringUtils.isEmpty(sss))
            return "empty";

        switch (sss) {
            case "s":
                return "success";
            case "f":
                return "failed";
            default:
                return "default";
        }
    }

    @Override
    public Mod b(Mod mod) {
        if (mod == null) {
            mod = new Mod();
        }
        mod.setId(10086);
        return mod;
    }
}
